package com.liuyjy.es.service;

/**
 * @Author liuyjy
 * @Date 2025/2/26 10:20
 * @Description: 多租户支持：
 **/
public class TenantAwareEsService {
    private ThreadLocal<String> currentTenant = new ThreadLocal<>();

    public void setTenant(String tenantId) {
        currentTenant.set(tenantId);
    }

    private String getIndexName(String baseName) {
        return currentTenant.get() + "_" + baseName;
    }
}
